import { lazy } from 'react'
import React from 'react'

// Heavy form components - lazy load the JSON Schema Form
export const LazyConfigurationForm = lazy(() =>
  import('@rjsf/core').then(module => ({
    default: module.default
  }))
)

// Lazy load the audit table component
export const LazyAuditTable = lazy(() =>
  import('../pages/AuditPage').then(module => ({
    default: module.AuditPage
  }))
)

// Plugin interface wrapper for lazy loading
// Note: PluginInterface component doesn't exist yet, so we'll create a placeholder
const PluginInterfacePlaceholder: React.ComponentType = () => {
  return React.createElement('div', {
    className: 'p-4 text-center text-muted-foreground'
  }, 'Plugin interface will be implemented here')
}

export const LazyPluginInterface = lazy(() =>
  Promise.resolve({
    default: PluginInterfacePlaceholder
  })
)
